const {
  setexchangeCoupon
} = require('../../../api/api.js');
const {
  _showToast
} = require('../../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    textValue: null
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {},
  change: function (e) {
    //检测输入变化的值
    const value = (e.detail.value)
    this.setData({
      textValue: value
    })
  },
  setConversion() {
    const num = this.data.textValue
    setexchangeCoupon(num).then(res => {
      _showToast(res.msg)
    }).catch(err => {
      console.log(err)
    })
  }
})